/**
 * Created by zhaojm on 15/4/25.
 */
game.WelcomeLayer = cc.Layer.extend({
    ctor:function(){
        this._super();
        var self = this;

        var winSize = cc.winSize;

        var txt;
        if(game._Config.language == game._Enum.language.cn){

            txt = cc.LabelTTF.create('点击屏幕开始游戏...', 'Arial', 24);
        }else{
            txt = cc.LabelTTF.create('TAP TO START...', 'Arial', 24);
        }
        txt.setColor(new cc.Color(231, 231, 231));
        txt.setPosition(cc.p(winSize.width * 0.5, winSize.height  * 0.5));
        txt.setAnchorPoint(cc.p(0.5, 0.5));
        this.addChild(txt);



        this._listener = cc.EventListener.create({
            event: cc.EventListener.TOUCH_ONE_BY_ONE,
            swallowTouches: true,// true 为不向下传递
            onTouchBegan: function(touch, event){
                cc.log('touch on welcome');

                self.parent.start();
                cc.eventManager.removeListener(self._listener);
                self.removeFromParent();


                return true;
            }
        });

        cc.eventManager.addListener(this._listener, this);


    },
});